<?php
require("messageDao.Class.php");
class messageLogic
{
    private $m_messageDao;

    public function __construct($strHost, $strUserName, $strPassWord, $strDatabase)
    {
        $this->m_messageDao = new messageDao($strHost, $strUserName, $strPassWord, $strDatabase);
    }

    public function __destruct()
    {
        unset($this->m_messageDao);
    }

    public function messageTopList($intTopN)
    {
        return $this->m_messageDao->messageTopList($intTopN);
    }

    public function messageTopContent($intTopMesgId)
    {
        return $this->m_messageDao->messageTopContent($intTopMesgId);
    }

    public function addTopMessage($strMesgTitle, $strMesgContent)
    {
        return $this->m_messageDao->addTopMessage($strMesgTitle, $strMesgContent);
    }

    public function delTopMessage($intTopMesgId)
    {
        return $this->m_messageDao->delTopMessage($intTopMesgId);
    }

    public function messageList($intUserId, $intTypeId)
    {
        return $this->m_messageDao->messageList($intUserId, $intTypeId);
    }

    public function messageCount($intUserId)
    {
        return $this->m_messageDao->messageCount($intUserId);
    }

    public function messageContent($intUserId, $intMesgId)
    {
        return $this->m_messageDao->messageContent($intUserId, $intMesgId);
    }

    public function sendMessage($arrMesgInfo)
    {
        return $this->m_messageDao->sendMessage($arrMesgInfo);
    }

    public function setMessageReaded($intUserId, $intMesgId)
    {
        return $this->m_messageDao->setMessageReaded($intUserId, $intMesgId);
    }

    public function setMessageAllReaded($intUserId, $intTypeId)
    {
        return $this->m_messageDao->setMessageAllReaded($intUserId, $intTypeId);
    }

    public function deleteRecvMessage($intUserId, $intMesgId)
    {
        return $this->m_messageDao->deleteRecvMessage($intUserId, $intMesgId);
    }

    public function deleteSendMessage($intUserId, $intMesgId)
    {
        return $this->m_messageDao->deleteSendMessage($intUserId, $intMesgId);
    }
};
?>
